import { Login } from "@/api/interface/index";
import { PORT1 } from "@/api/config/servicePort";
import { obj2fd } from "@/utils/index";
import http from "@/api";
// 查询列表
export const getDataByPage = (params: object) => {
  return http.get(PORT1 + `/secure/srvcfgList/${params.pageNum}/${params.pageSize}`); // 正常 post json 请求  ==>  application/json
};
// 获取协议列表
export const getAppData = () => {
  return http.get(PORT1 + `/secure/getAppList`); // 正常 post json 请求  ==>  application/json
};
// 新增
export const addData = (params: object) => {
  return http.post(PORT1 + `/secure/fingAdd`, params, { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 更新
export const editData = (params: object) => {
  return http.post(PORT1 + `/secure/srvcfgUpdateText`, params, { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 更新
export const editPri = (params: object) => {
  return http.post(PORT1 + `/secure/srvcfgUpdatePri/${params.id}/${params.pri}`, params, { loading: false }); // 正常 post json 请求  ==>  application/json
};
// 更新
export const updateFileByWeb = (params: object) => {
  return http.post(PORT1 + `/secure/srvcfgUpdateFile/5`, obj2fd({ file: params.file }), { loading: false }); // 正常 post json 请求  ==>  application/json
};
